﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[Serializable]
public class InitHero
{
    public long id;
    public string name;
    /// <summary>
    /// 职业 1.盾 2.医 3.辅 4.战
    /// </summary>
    public byte job;
    /// <summary>
    /// 品质
    /// </summary>
    public int quality;
    /// <summary>
    /// 生命
    /// </summary>
    public int hp;
    /// <summary>
    /// 攻击力
    /// </summary>
    public int atk;
    /// <summary>
    /// 物理防御
    /// </summary>
    public int def;
    /// <summary>
    /// 魔法防御
    /// </summary>
    public int rgs;
    /// <summary>
    /// 命中率
    /// </summary>
    public int dex;
    /// <summary>
    /// 暴击率
    /// </summary>
    public int crt;
    /// <summary>
    /// 回避率
    /// </summary>
    public int evd;
    /// <summary>
    /// 抗暴率
    /// </summary>
    public int kbl;
    /// <summary>
    /// 伤害加成
    /// </summary>
    public int amp;
    /// <summary>
    /// 技能加深
    /// </summary>
    public int skill_up;
    /// <summary>
    /// 技能抗性
    /// </summary>
    public int skill_res;
    /// <summary>
    /// 伤害减免
    /// </summary>
    public int damage_res;
    /// <summary>
    /// 出场能量
    /// </summary>
    public int energy;
    /// <summary>
    /// 普通技能Id
    /// </summary>
    public int normal_skill_id;
    /// <summary>
    /// 专属技能Id
    /// </summary>
    public int proper_skill_id;
    public int up_value;
    /// <summary>
    /// 角色介绍
    /// </summary>
    public string info;
}

public class InitHeroMgr
{
    public static Dictionary<long, InitHero> Dict { get; private set; }

    public static void Load()
    {
        List<InitHero> initRoles = StaticDataReader.LoadJsonFromFile<InitHero>("static_init_hero");
        if (initRoles != null)
        {
            Dict = new Dictionary<long, InitHero>(initRoles.Count);
            for(int i=0; i<initRoles.Count; i++)
            {
                Dict.Add(initRoles[i].id, initRoles[i]);
            }
        }
        else
        {
            Dict = new Dictionary<long, InitHero>();
        }
    }
}
